const app = getApp();
const util = require('../../../utils/util.js')
Page({
  data: {
  },

  loadData:function(e){
    var that = this;
    util.request('my/index', {}, function (data) {
      if(data.code == 1){
        that.setData({
          data:data.data.data,
        })
      }else{
        util.fail(data.msg,that);
      }
    });
  },

  onLoad:function(){
    this.setData({
      openId:app.globalData.openId,
      parent:app.globalData.parent,
      login:app.globalData.login,
    })
    if(this.data.login){
      this.loadData();
    }

  },
  onShow: function () {
    this.setData({
      openId:app.globalData.openId,
      parent:app.globalData.parent,
      login:app.globalData.login,
    })
    if(this.data.login){
      this.loadData();
    }
  },


})
